<?php
	$j['message']['message'] = $message;
	$j['message']['integrityFault'] = $integrityFault;
	
	if($sikeres){
		$j['title'] = __('New task', true) . ' / ' . __('Details', true);
		$j['start'] = $ma['sql'];

		$j['categories_id'] = isset($datas) ? $datas['Task']['categories_id'] : $szuloValues['Task']['categories_id'];
		$j['priorities_id'] = isset($datas) ? $datas['Task']['priorities_id'] : $szuloValues['Task']['priorities_id'];
		$j['priority'] = isset($datas) ? $datas['Priority']['priority'] : $szuloValues['Priority']['priority'];
		
		$j['types_id'] = isset($datas) ? $datas['Task']['types_id'] : $szuloValues['Task']['types_id'];
		$j['szulo'] = ($szuloid) ? $szuloid : $szuloValues['Task']['id'];
		$j['task'] = isset($datas) ? $datas['Task']['task'] : '';
		$j['tags'] = isset($datas) ? $datas['Tag'] : null;
		$j['details'] = isset($datas) ? $datas['Task']['details'] : '';
		$d = isset($datas) ? $datas['Task']['due'] : $szuloValues['Task']['due'];
		$j['due'] = ($d<$ma['sql']) ? $ma['sql'] : $d;
		$j['path'] = isset($path) ? $path : null;
		$j['id'] = isset($datas) ? $datas['Task']['id'] : 0;
		$j['quickinfo'] = isset($qi) ? $qi : null;
	
		if(isset($datas)){
			$tree = '';
			foreach($szuloTree as $sz){
				if($sz['id'])
					$tree .= '<option value="'.$sz['id'].'" id="o'.$sz['id'].'">'.$sz['task'].'</option>' . "\n";
				}
			$j['szuloTree'] = $tree;
			$j['submit'] = __('Edit', true);
			$j['action'] = 'edit';
		}
		else{
			$j['szuloTree'] = null;
			$j['submit'] = __('Add', true);
		}
	}
	
	print $javascript->object($j);
?>